<%@ page language="java" pageEncoding="utf-8" %>
<%@ include file="/include/taglibs.jsp" %>
<style>
    .fixed-table-container {
        height: auto !important;
        padding-bottom: 0 !important;
    }

    .fixed-table-pagination .pagination-detail, .fixed-table-pagination div.pagination {
        margin-top: 15px !important;
    }
</style>
<script src="${path}/static/security/admin/index.js"></script>
<link rel="stylesheet" href="${path}/static/css/public/order.css">
<div class="form-inline" role="form" id="admintoolbar">
    <input id="admin" type="hidden" value="<%=request.getSession().getAttribute("super") %>"/>
    <button type="button" class="btn btn-default btn-default-button" id="addAdmin">
        <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
        创建账号
    </button>

    <%--<button type="button" class="btn btn-default btn-default-button" id="fenzu">--%>
        <%--<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>--%>
        <%--自动分组--%>
    <%--</button>--%>

    <button type="button" class="btn btn-default btn-default-button" id="DuanXinYouJian">
        <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
        短信邮件通知
    </button>
</div>

<table id="table"
       data-toggle="table"
       data-toolbar="#admintoolbar"
       data-url="${path}/web/ensadmin/adminQuery?roleId=13"
       data-height="540"
       data-side-pagination="server"
       data-pagination="true"
       data-page-list="[5, 10, 20, 50, 100, 200]"
       data-search="true" data-show-refresh="true"
       data-search-tip="搜索用户账号"
       data-show-columns="true">
    <thead>
    <tr>
        <th data-field="id">编号</th>
        <th data-field="userName">用户账号</th>
        <th data-field="linkman">联系人</th>
        <th data-field="phone">手机号</th>
        <th data-field="job">职务</th>
        <th data-field="orgName">机构名称</th>
        <th data-field="lastDate">最后登录时间</th>
        <th data-field="enable" data-formatter="Admin.showEnable">状态</th>
    </tr>
    </thead>
</table>

<div id="addAdmin-div" class="slidingmenu box-model box box-info">
    <div class="box box-info">
        <div class="box-header">
            <h3 class='box-title'>
                <button class="btn btn-error close-model">关闭</button>
            </h3>
            <button class="btn btn-info form-submit" form-id="adminForm">保存</button>
        </div>
        <div class="box-body">
            <form role="form" action="/web/ensadmin/saveOrUpdateAdmin" method="post" id="adminForm"
                  data-callback="saveAdmin">
                <input type="hidden" name="id"/>
                <input type="hidden" name="roleId" value="13"/>

                <div class="form-group">
                    <label>机构账号:<a href="#" data-toggle="tooltip" data-placement="right"
                                   title="机构账号必须是手机号">?</a></label>
                    <input type="text" id="admin_name" class="form-control" name="userName" data-msg="请输入手机号"
                           placeholder="请输入手机号" check-type="mobile" required="true"  id="sureMob"/>
                </div>
                <div class="form-group">
                    <label>用户密码:<a href="#" data-toggle="tooltip" data-placement="right"
                                   title="请认真填写密码">?</a></label>
                    <input type="text" id="admin_pwd" class="form-control" name="pwd" placeholder="请输入密码"
                           required="true" rangelength="[6,16]"/>
                </div>
                <div class="form-group">
                    <label>联系人:<a href="#" data-toggle="tooltip" data-placement="right"
                                  title="请认真填写联系人">?</a></label>
                    <input type="text" class="form-control" name="linkman" data-msg="请输入联系人"
                           placeholder="请输入联系人" required="true" maxlength="40"/>
                </div>
                <div class="form-group">
                    <label>手机号:<a href="#" data-toggle="tooltip" data-placement="right"
                                  title="请填写联系人手机号">?</a></label>
                    <input type="text" class="form-control" name="phone" data-msg="请输入联系人手机号"
                           placeholder="请输入联系人手机号" required="true" maxlength="16"/>
                </div>
                <div class="form-group">
                    <label>机构名称:<a href="#" data-toggle="tooltip" data-placement="right"
                                   title="请认真填写机构名称">?</a></label>
                    <input type="text" class="form-control" name="orgName" data-msg="请输入机构名称"
                           placeholder="请输入机构名称" required="true" maxlength="50"/>
                </div>
                <div class="form-group">
                    <label>职务:<a href="#" data-toggle="tooltip" data-placement="right"
                                 title="请认真填写职务">?</a></label>
                    <input type="text" class="form-control" name="job" data-msg="请输入职务"
                           placeholder="请输入职务" required="true" maxlength="30"/>
                </div>
                <div class="form-group">
                    <label>邮箱:<a href="#" data-toggle="tooltip" data-placement="right"
                                 title="请认真填写邮箱">?</a></label>
                    <input type="text" class="form-control" name="email" data-msg="请输入邮箱"
                           placeholder="请输入邮箱" required="true"/>
                </div>

                <!--新增加的字段-->
                <div class="form-group">
                    <label>单位名称:<a href="#" data-toggle="toggle" data-placement="right" title="请认真填写单位名称">?</a></label>
                    <input type="text" class="form-control" name="unitName" data-msg="请输入单位名称"
                           placeholder="请输入单位名称" />
                </div>
                <div class="form-group">
                    <label>资金规模:<a href="#" data-toggle="toggle" data-placement="right" title="请认真填写资金规模">?</a></label>
                    <input type="text" class="form-control" name="fundSize" data-msg="请输入资金规模"
                           placeholder="请输入资金规模" />
                </div>
                <div class="form-group">
                    <label>投资领域偏好:<a href="#" data-toggle="toggle" data-placement="right" title="请认真填写投资领域偏好">?</a></label>
                    <input type="text" class="form-control" name="investPrefer" data-msg="请输入投资领域偏好"
                           placeholder="请输入投资领域偏好" />
                </div>
                <div class="form-group">
                    <label>微信:<a href="#" data-toggle="toggle" data-placement="right" title="请认真填写微信">?</a></label>
                    <input type="text" class="form-control" name="wechat" data-msg="请输入微信"
                           placeholder="请输入微信" />
                </div>

            </form>
        </div><!-- /.box-body -->
    </div>
</div>

<div id="editAdmin-div" class="slidingmenu box-model box box-info slidingmenu-show" callback="Admin.editAdminShow">
    <div class="box box-info">
        <div class="box-header">
            <h3 class='box-title'><i class='fa fa-close close-model'>&nbsp;&nbsp;</i></h3>
            <button class="btn btn-info form-submit" form-id="mergeAdmin">修改</button>
            <button class="btn btn-danger" id="deleteAdmin">删除</button>
        </div>
        <div class="box-body">
            <form role="form" id="mergeAdmin" action="/web/ensadmin/saveOrUpdateAdmin" method="post">
                <input type="hidden" id="id" name="id"/>
                <input type="hidden" name="roleId" value="13"/>

                <div class="form-group">
                    <label>机构账号:<a href="#" data-toggle="tooltip" data-placement="right"
                                   title="机构账号必须是手机号">?</a></label>
                    <input type="text" id="modify_admin" class="form-control" name="userName" data-msg="请输入手机号"
                           placeholder="请输入手机号" check-type="mobile"/>
                </div>

                <div class="form-group">
                    <label>用户密码:</label>
                    <input type="text" id="modify_admin_pwd" class="form-control" name="pwd" placeholder="请输入密码"
                           required="true" rangelength="[6,16]"/>
                </div><!-- /.form group -->
                <div class="form-group">
                    <label>联系人:<a href="#" data-toggle="tooltip" data-placement="right"
                                  title="请认真填写联系人">?</a></label>
                    <input type="text" class="form-control" name="linkman" data-msg="请输入联系人"
                           placeholder="请输入联系人" required="true" maxlength="16"/>
                </div>
                <div class="form-group">
                    <label>手机号:<a href="#" data-toggle="tooltip" data-placement="right"
                                  title="请填写联系人手机号">?</a></label>
                    <input type="text" class="form-control" name="phone" data-msg="请输入联系人手机号"
                           placeholder="请输入联系人手机号" required="true" maxlength="16"/>
                </div>
                <div class="form-group">
                    <label>机构名称:<a href="#" data-toggle="tooltip" data-placement="right"
                                   title="请认真填写机构名称">?</a></label>
                    <input type="text" class="form-control" name="orgName" data-msg="请输入机构名称"
                           placeholder="请输入机构名称" required="true" maxlength="50"/>
                </div>
                <div class="form-group">
                    <label>职务:<a href="#" data-toggle="tooltip" data-placement="right"
                                 title="请认真填写职务">?</a></label>
                    <input type="text" class="form-control" name="job" data-msg="请输入职务"
                           placeholder="请输入职务" required="true" maxlength="30"/>
                </div>

                <div class="form-group">
                    <label>姓名:<a href="#" data-toggle="tooltip" data-placement="right"
                                 title="请认真填写姓名">?</a></label>
                    <input type="text" class="form-control" name="name" data-msg="请输入姓名"
                           placeholder="请输入姓名" required="true" />
                </div>

                <div class="form-group">
                    <label>单位名称:<a href="#" data-toggle="toggle" data-placement="right" title="请认真填写单位名称">?</a></label>
                    <input type="text" class="form-control" name="unitName" data-msg="请输入单位名称"
                           placeholder="请输入单位名称" />
                </div>
                <div class="form-group">
                    <label>资金规模:<a href="#" data-toggle="toggle" data-placement="right" title="请认真填写资金规模">?</a></label>
                    <input type="text" class="form-control" name="fundSize" data-msg="请输入资金规模"
                           placeholder="请输入资金规模" />
                </div>
                <div class="form-group">
                    <label>投资领域偏好:<a href="#" data-toggle="toggle" data-placement="right" title="请认真填写投资领域偏好">?</a></label>
                    <input type="text" class="form-control" name="investPrefer" data-msg="请输入投资领域偏好"
                           placeholder="请输入投资领域偏好" />
                </div>
                <div class="form-group">
                    <label>微信:<a href="#" data-toggle="toggle" data-placement="right" title="请认真填写微信">?</a></label>
                    <input type="text" class="form-control" name="wechat" data-msg="请输入微信"
                           placeholder="请输入微信" />
                </div>
            </form>
        </div>
    </div>
</div>
